"btn"
Bootstrap 3.3.0 Snippet by SANTANU CHOWDHURY

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <nav class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <div class="stage"> <div class="container"> <div class="line-top"></div> <div class="line-middle"></div> <div class="line-bottom"></div> </div> </div> </button> <a class="navbar-brand" href="#">Brand</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div class="stage"> <div class="container"> <div class="line-top"></div> <div class="line-middle"></div> <div class="line-bottom"></div> </div> </div>
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: transparent; } .navbar-default .navbar-toggle { border-color: transparent; } .navbar-toggle { padding: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-right: 10px; } /* ------------ animation ------------ */ .container { margin-top: 8px; position: relative; height: 28px; width: 36px; cursor: pointer; } .container .line-top, .container .line-middle, .container .line-bottom { position: absolute; display: block; height: 2px; width: 36px; border-radius: 2px; background: #000; left:0px; } .container .line-top { top: 0; transform-origin: 34px 2px; } .container .line-middle { top: 12px; transition: opacity 200ms linear; } .container .line-bottom { bottom: 2px; transform-origin: 34px 2px; } .container.is-open .line-top { animation: line-top-out 600ms linear normal; animation-fill-mode: forwards; } .container.is-open .line-middle { opacity: 0; } .container.is-open .line-bottom { animation: line-bot-out 600ms linear normal; animation-fill-mode: forwards; } .container.is-closed .line-top { animation: line-top-in 600ms linear normal; animation-fill-mode: forwards; } .container.is-closed .line-middle { transition-delay: 200ms; } .container.is-closed .line-bottom { animation: line-bot-in 600ms linear normal; animation-fill-mode: forwards; } @keyframes line-top-in { 0% { left: -5px; bot: 0; transform: rotate(-45deg); } 20% { left: -5px; bot: 0; transform: rotate(-60deg); } 80% { left: 0; bot: 0; transform: rotate(15deg); } 100% { left: 0; bot: 1px; transform: rotate(0deg); } } @keyframes line-top-out { 0% { left: 0; top: 0; transform: rotate(0deg); } 20% { left: 0; top: 0; transform: rotate(15deg); } 80% { left: -5px; top: 0; transform: rotate(-60deg); } 100% { left: -5px; top: 1px; transform: rotate(-45deg); } } @keyframes line-bot-in { 0% { left: -5px; transform: rotate(45deg); } 20% { left: -5px; bot: 0; transform: rotate(60deg); } 80% { left: 0; bot: 0; transform: rotate(-15deg); } 100% { left: 0; transform: rotate(0deg); } } @keyframes line-bot-out { 0% { left: 0; transform: rotate(0deg); } 20% { left: 0; transform: rotate(-15deg); } 80% { left: -5px; transform: rotate(60deg); } 100% { left: -5px; transform: rotate(45deg); } }
$(function() { $(".container").on("click", function() { var that = $(this); if (that.hasClass("is-open")) { that.removeClass("is-open").addClass("is-closed"); } else { that.removeClass("is-closed").addClass("is-open"); } }); });

Related: See More


Questions / Comments: